Last updated: 2022-08-18

Checks: 7 0

Knit directory: masters-thesis/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20220406) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 13e6cb8. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .RData
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/03_sequential_vs_parallelization_WDPA.Rmd) and HTML (docs/03_sequential_vs_parallelization_WDPA.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 13e6cb8 Ohm-Np 2022-08-18 updates on results
html 0e8abee Ohm-Np 2022-08-09 Build site.
Rmd e7d2d14 Ohm-Np 2022-08-09 graphs re-coloured
html e7d2d14 Ohm-Np 2022-08-09 graphs re-coloured
html 8b15f8a Ohm-Np 2022-06-30 Build site.
Rmd ff565ab Ohm-Np 2022-06-30 wflow_publish(“analysis/03_sequential_vs_parallelization_WDPA.Rmd”)
html f17c144 Ohm-Np 2022-06-30 Build site.
Rmd a6e6a5e Ohm-Np 2022-06-30 wflow_publish(“analysis/03_sequential_vs_parallelization_WDPA.Rmd”)
html f4e84e5 Ohm-Np 2022-06-10 Build site.
Rmd 33a0249 Ohm-Np 2022-06-10 major changes on files and page
html 33a0249 Ohm-Np 2022-06-10 major changes on files and page

Introduction

In this study, we are going to check how the processing time will differ - (1) sequential approach (2) parallel approach while processing rasters with varying resolutions and for different study areas:

  1. wdpa polygons (167)
  2. simplified wdpa polygons (152)
  3. fishnet gridded cells (14338)

Let’s see how these three different aoi polygons look like:

my_map

Four raster objects with varying resolutions were generated across the Bolivia region to carry out this study. The details of the rasters thus created follows:

  1. 0.1 degree (~11.1 km) = size 71.7 KB
  2. 0.01 degree (~1.11 km) = size 6.9 MB
  3. 0.001 degree (~111 m) = size 691.9 MB
  4. 0.0005 degree (~55.5 m) = size 2.7 GB

Results

To carry out this analysis, all the results are aggregated and group by raster resolutions. Thus, for specific raster resolution, we could recommend what could be the most suitable combination.

0.1 degree resolution (~11.1 km)

result

Version Author Date
e7d2d14 Ohm-Np 2022-08-09
f17c144 Ohm-Np 2022-06-30
33a0249 Ohm-Np 2022-06-10
result_new

Version Author Date
e7d2d14 Ohm-Np 2022-08-09
f17c144 Ohm-Np 2022-06-30

0.01 degree resolution (~1.11 km)

result

Version Author Date
e7d2d14 Ohm-Np 2022-08-09
f17c144 Ohm-Np 2022-06-30
33a0249 Ohm-Np 2022-06-10

terra zonal(4,8,16) have created much spikes over the graphs, so lets remove zonal and plot only terra extract and exact extract.

result_new

Version Author Date
e7d2d14 Ohm-Np 2022-08-09
f17c144 Ohm-Np 2022-06-30
33a0249 Ohm-Np 2022-06-10

0.001 degree resolution (~111 m)

result

Version Author Date
e7d2d14 Ohm-Np 2022-08-09
f17c144 Ohm-Np 2022-06-30
33a0249 Ohm-Np 2022-06-10

0.0005 degree resolution (~55.5 m)

result

Version Author Date
e7d2d14 Ohm-Np 2022-08-09
f17c144 Ohm-Np 2022-06-30
33a0249 Ohm-Np 2022-06-10

Conclusion

Rasters size Combination of functions and methods
0.1 degree (~11.1 km) 71.7 KB 1. terra zonal in single asset mode
0.01 degree (~1.11 km) 6.9 MB 1. terra zonal in single asset mode
2. exact extract in single asset mode
0.001 degree (~111 m) 691.9 MB 1. for wdpa polygons, exact extract with 16 cores
2. for fishnets, exact extract single asset
0.0005 degree (~55.5 m) 2.7 GB 1. for wdpa polygons, exact extract with 16 cores
2. for fishnets, exact extract single asset

terra zonal did not process very small polygons in many occasions, so if your study area contains very small areas, it is recommended not to opt terra zonal.


sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] magrittr_2.0.3        rmarkdown_2.14        plotly_4.9.3         
 [4] RColorBrewer_1.1-3    htmltools_0.5.3       scales_1.2.0         
 [7] ggsci_2.9             leaflet.extras2_1.1.0 leaflet.extras_1.0.0 
[10] exactextractr_0.7.2   leaflet_2.0.4.1       forcats_0.5.1        
[13] stringr_1.4.0         dplyr_1.0.9           purrr_0.3.4          
[16] readr_2.1.2           tibble_3.1.8          tidyverse_1.3.2      
[19] ggplot2_3.3.6         tidyr_1.2.0           terra_1.5-34         
[22] sf_1.0-8              workflowr_1.7.0      

loaded via a namespace (and not attached):
 [1] fs_1.5.2                lubridate_1.8.0         httr_1.4.3             
 [4] rprojroot_2.0.3         tools_3.6.3             backports_1.4.1        
 [7] bslib_0.3.1             utf8_1.2.2              R6_2.5.1               
[10] KernSmooth_2.23-20      lazyeval_0.2.2          DBI_1.1.3              
[13] colorspace_2.0-3        raster_3.5-12           withr_2.5.0            
[16] sp_1.5-0                tidyselect_1.1.2        processx_3.7.0         
[19] compiler_3.6.3          git2r_0.30.1            cli_3.3.0              
[22] rvest_1.0.2             xml2_1.3.3              labeling_0.4.2         
[25] sass_0.4.1              classInt_0.4-7          callr_3.7.1            
[28] proxy_0.4-27            digest_0.6.29           pkgconfig_2.0.3        
[31] highr_0.9               dbplyr_2.2.1            fastmap_1.1.0          
[34] htmlwidgets_1.5.4       rlang_1.0.4             readxl_1.4.0           
[37] rstudioapi_0.13         farver_2.1.1            jquerylib_0.1.4        
[40] generics_0.1.3          jsonlite_1.8.0          crosstalk_1.2.0        
[43] googlesheets4_1.0.0     Rcpp_1.0.9              munsell_0.5.0          
[46] fansi_1.0.3             lifecycle_1.0.1         stringi_1.7.8          
[49] whisker_0.4             yaml_2.3.5              grid_3.6.3             
[52] promises_1.2.0.1        crayon_1.5.1            lattice_0.20-45        
[55] haven_2.5.0             hms_1.1.1               knitr_1.39             
[58] ps_1.7.1                pillar_1.8.0            codetools_0.2-18       
[61] reprex_2.0.1            glue_1.6.2              evaluate_0.15          
[64] getPass_0.2-2           leaflet.providers_1.9.0 data.table_1.14.2      
[67] modelr_0.1.8            vctrs_0.4.1             tzdb_0.3.0             
[70] httpuv_1.6.5            cellranger_1.1.0        gtable_0.3.0           
[73] assertthat_0.2.1        xfun_0.31               broom_1.0.0            
[76] e1071_1.7-11            later_1.3.0             viridisLite_0.4.0      
[79] class_7.3-20            googledrive_2.0.0       gargle_1.2.0           
[82] units_0.8-0             ellipsis_0.3.2